<?php
$sql = "
CREATE TABLE IF NOT EXISTS " . tablename('yuan_shop_order') . " (
`id` int(10) AUTO_INCREMENT,
`weid` varchar(200) NOT NULL,
`commodityid` int(10) NOT NULL,
`memberid` int(10) NOT NULL,
`ordernum` varchar(50) NOT NULL,
`borntime` varchar(50) NOT NULL,
`status` int(50) NOT NULL COMMENT '1已支付待收货,2已下单待付款,3确认收货订单完成 ,4申请退款中,5承诺退款,6货到退款成功',
PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS " . tablename('yuan_shop_commodity') . " (
`id` int(10) AUTO_INCREMENT,
`weid` varchar(200) NOT NULL,
`commoditytypeid` int(10) NOT NULL,
`expressid` int(10) NOT NULL,
`commodityname` varchar(50) NOT NULL,
`commodityprize` int(50) NOT NULL,
`commoditystatus` tinyint(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS " . tablename('yuan_shop_commoditytype') . " (
`id` int(10) AUTO_INCREMENT,
`weid` varchar(200) NOT NULL,
`commoditytypename` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS " . tablename('yuan_shop_commoditysontype') . " (
`id` int(10) AUTO_INCREMENT,
`weid` varchar(200) NOT NULL,
`commoditytypeid` int(10) NOT NULL,
`commoditysontypename` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS " . tablename('yuan_shop_member') . " (
`id` int(10) AUTO_INCREMENT,
`weid` varchar(200) NOT NULL,
`uid int(10) NOT NULL,
`memberpayall` int(50) NOT NULL, 
PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS " . tablename('yuan_shop_express') . " (
`id` int(10) AUTO_INCREMENT,
`weid` varchar(200) NOT NULL,
`expressid` int(50) NOT NULL,
`expressname` int(50) NOT NULL,
`expresspayrule` longtext NOT NULL COMMENT '支付规则（xx地区支付xx运费）json',
PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
";
pdo_query($sql);